package com.jintian.smart.kernel.common.expr.op.define;

import com.jintian.smart.kernel.common.expr.datameta.BaseDataMeta;
import com.jintian.smart.kernel.common.expr.datameta.Constant;
import com.jintian.smart.kernel.common.expr.op.Operator;
import com.jintian.smart.kernel.core.expr.IllegalExpressionException;

/**
 * 逻辑小于操作
 * 
 */
public class Op_LT extends Op_Base {
	public Op_LT() {
		super(Operator.LT);
	}

	public Constant execute(Constant[] args) throws IllegalExpressionException {
		Object[] params = this.getParameterValues(args);
		int compare = this.compare(params[0], params[1], null);
		return new Constant(BaseDataMeta.DataType.DATATYPE_BOOLEAN, compare < 0);
	}

	public Constant verify(int opPositin, BaseDataMeta[] args) throws IllegalExpressionException {
		this.checkParameterCount(opPositin, args);
		return new Constant(BaseDataMeta.DataType.DATATYPE_BOOLEAN, Boolean.FALSE);
	}
}
